
# 介绍路由
# flask路由

# 这是一个最简单的服务后端
# 1、下载flask后导入
from flask import Flask

app = Flask(__name__)

# @app.route('/',methods=['get','POST'],endpoint="world")
# def index():
#     return "hello_world"
# @app.route('/hello',methods=['get','POST'],endpoint="flask")
# def index():
#     return "<h1>hello_flask</h1>"

@app.route('/user/<int:id>')
def index(id):
    if(id==1):
        return "人生苦短，我用python"
    if(id == 2):
        return "python虽好，框架更易"
    if(id == 3):
        return "flask 框架好用"
    return "hello_world"

if __name__ == '__main__':
    app.run()



